generic type variable - definição. O que é generic type variable. Significado, conceito
Diclib.com
Dicionário ChatGPT
Digite uma palavra ou frase em qualquer idioma 👆
Idioma:

Tradução e análise de palavras por inteligência artificial ChatGPT

Nesta página você pode obter uma análise detalhada de uma palavra ou frase, produzida usando a melhor tecnologia de inteligência artificial até o momento:

  • como a palavra é usada
  • frequência de uso
  • é usado com mais frequência na fala oral ou escrita
  • opções de tradução de palavras
  • exemplos de uso (várias frases com tradução)
  • etimologia

O que (quem) é generic type variable - definição

WAY OF DESIGNING AND WRITING PROGRAMS WHERE ALGORITHMS ARE WRITTEN IN TERMS OF PARAMETRIC TYPES ENABLING EASY REUSE
Genericity; Parameterized class; Instantiation of template; Template class; Template specialization; Parameterized type; Generic algorithm; Template specialisation; Generic types; Generic type; Generic class; Generic datatype; Generics in Ada; Comparison of programming languages (generics)

generic type variable      
<programming> (Also known as a "schematic type variable"). Different occurrences of a generic type variable in a type expression may be instantiated to different types. Thus, in the expression let id x = x in (id True, id 1) id's type is (for all a: a -> a). The universal quantifier "for all a:" means that a is a generic type variable. For the two uses of id, a is instantiated to Bool and Int. Compare this with let id x = x in let f g = (g True, g 1) in f id This looks similar but f has no legal Hindley-Milner type. If we say f :: (a -> b) -> (b, b) this would permit g's type to be any instance of (a -> b) rather than requiring it to be at least as general as (a -> b). Furthermore, it constrains both instances of g to have the same result type whereas they do not. The type variables a and b in the above are implicitly quantified at the top level: f :: for all a: for all b: (a -> b) -> (b, b) so instantiating them (removing the quantifiers) can only be done once, at the top level. To correctly describe the type of f requires that they be locally quantified: f :: ((for all a: a) -> (for all b: b)) -> (c, d) which means that each time g is applied, a and b may be instantiated differently. f's actual argument must have a type at least as general as ((for all a: a) -> (for all b: b)), and may not be some less general instance of this type. Type variables c and d are still implicitly quantified at the top level and, now that g's result type is a generic type variable, any types chosen for c and d are guaranteed to be instances of it. This type for f does not express the fact that b only needs to be at least as general as the types c and d. For example, if c and d were both Bool then any function of type (for all a: a -> Bool) would be a suitable argument to f but it would not match the above type for f.
Generic drug         
  • Generic Drugs Research
PHARMACEUTICAL DRUG THAT IS EQUIVALENT TO A BRAND-NAME PRODUCT IN DOSAGE, STRENGTH, ROUTE OF ADMINISTRATION, QUALITY, PERFORMANCE, AND INTENDED USE
Generic medicine; Generic pharmaceutics; Generic drugs; Generic drug names; Generic drugs information; Drugs, generic; Generic-named drug; Generic formulation; Generic medication; Generic medications; Generic medicines; Generic medicament; Generic medicaments; Generic Multivitamin; Generic pharmaceuticals; Generic version; Affordable drugs; Affordable drug; Patent free pharmaceuticals; Market exclusivity; Marketing exclusivity
A generic drug is a pharmaceutical drug that contains the same chemical substance as a drug that was originally protected by chemical patents. Generic drugs are allowed for sale after the patents on the original drugs expire.
Variable (computer science)         
STORAGE LOCATION PAIRED WITH A NAME, WHICH CONTAINS A VALUE
Program variable; Scalar variable; Variable scope; Simple variable; Variable (computing); Variable (programming); Variable lifetime; Scope and extent; Variable scope and extent; Variable extent; Variable (computer programming); Storage location; Assignable variable
In computer programming, a variable is an abstract storage location paired with an associated symbolic name, which contains some known or unknown quantity of information referred to as a value; or in simpler terms, a variable is a named container for a particular set of bits or type of data (like integer, float, string etc...).

Wikipédia

Generic programming

Generic programming is a style of computer programming in which algorithms are written in terms of types to-be-specified-later that are then instantiated when needed for specific types provided as parameters. This approach, pioneered by the ML programming language in 1973, permits writing common functions or types that differ only in the set of types on which they operate when used, thus reducing duplication. Such software entities are known as generics in Ada, C#, Delphi, Eiffel, F#, Java, Nim, Python, Go, Rust, Swift, TypeScript and Visual Basic .NET. They are known as parametric polymorphism in ML, Scala, Julia, and Haskell (the Haskell community also uses the term "generic" for a related but somewhat different concept); templates in C++ and D; and parameterized types in the influential 1994 book Design Patterns.

The term "generic programming" was originally coined by David Musser and Alexander Stepanov in a more specific sense than the above, to describe a programming paradigm whereby fundamental requirements on types are abstracted from across concrete examples of algorithms and data structures and formalized as concepts, with generic functions implemented in terms of these concepts, typically using language genericity mechanisms as described above.